<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@include file="/view/common/header-company.jspf" %>
	<title>天朝企业</title>
		<center>
		<h1>企业资料展示</h1>
	</center>
	<div class="container">
	<form class="form-horizontal" role="form"
		action="<%=request.getContextPath()%>/CompanyServlet?command=updateCompany" method="post" onsubmit="return validate();">
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">code</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="code"
					placeholder="code" id="code"  disabled="disabled" value="${sessionScope.company.code }">
			</div>
		<span id="codeInfo" class="bg-danger text-muted"></span>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">password</label>
			<div class="col-sm-10">
				<input type="password" class="form-control" name="password"
					placeholder="Password" id="pwd" value="${sessionScope.company.password }">
			</div>
		<span id="pwdInfo" class="bg-danger text-muted"></span>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">name</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="name"
					placeholder="name" id="name"  readonly="readonly" value="${sessionScope.company.name }">
			</div>
			<span id="nameInfo" class="bg-danger text-muted"></span>
		</div>
		
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">e-mail</label>
			<div class="col-sm-10">
				<input type="email" class="form-control" name="email"
					placeholder="email"  value="${sessionScope.company.email }">
			</div>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">phone</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="phone"
					placeholder="phone"  value="${sessionScope.company.phone }">
			</div>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">linkman</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="linkman"
					placeholder="linkman"  value="${sessionScope.company.linkman }">
			</div>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">address</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="address"
					placeholder="address"  value="${sessionScope.company.address }">
			</div>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">numbers</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="numbers"
					placeholder="numbers"  value="${sessionScope.company.numbers }">
			</div>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">slogan</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="slogan"
					placeholder="slogan"  value="${sessionScope.company.slogan }">
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10"">
				<button type="submit" class="btn btn-default">修改</button>
				 <input type="button" class="btn btn-primary" onclick="javascript:history.back();" value="返回"/>
			</div>
		</div>
	</form>
	</div>
	<script>
			
			/**
			 * 表单验证
			 */
			function validate() {
				var result = true;
				var code = document.getElementById("code");
				var pwd = document.getElementById("pwd");
				var name = document.getElementById("name");
				if(code.value == ''){
					document.getElementById("codeInfo").innerHTML="用户名不能为空";
					result = false;
				}else{
					document.getElementById("codeInfo").innerHTML="";
				}
				if(pwd.value == ''){
					document.getElementById("pwdInfo").innerHTML="密码不能为空";
					result = false;
				}else{
					document.getElementById("pwdInfo").innerHTML="";
				}
				if(name.value == ''){
					document.getElementById("nameInfo").innerHTML="用户名不能为空";
					result = false;
				}else{
					document.getElementById("nameInfo").innerHTML="";
				}
				
				return result;
			}
			/**
			*el获取是否修改成功信息(相当于request.getParameter(arg0))
			*/
			if('${param.updateSuccess}'){
				layer.msg('修改成功！',{icon:1});
			}
			if('${param.updateError}'){
				layer.msg('修改失败！',{icon:0});
			}
			
		</script>
</body>
<link rel="shortcut icon" href="<%=request.getContextPath()%>/static/common/img/favicon.ico"/>
</html>